﻿<Page x:Class="DTC.Pages.PatiensListPage"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Res="clr-namespace:DTC.Resources"
        xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:Controls="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" Title="MedRecordsListPage" MaxHeight="850" MaxWidth="1150"
	    SnapsToDevicePixels="True">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Brushes.xaml"/>
                <ResourceDictionary Source="../Resources/ListBoxStyles.xaml"/>
                <ResourceDictionary Source="../Resources/TextEditStyles.xaml"/>
                <ResourceDictionary Source="../Resources/ButtonsStyles.xaml"/>
                <ResourceDictionary Source="../Resources/TextBlockStyles.xaml"/>
                <ResourceDictionary Source="../Resources/BorderStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Border x:Key="SearchToolTipText" Padding="5">
                <StackPanel>
                    <TextBlock>
                        В строке поиска вы можете указать следующую информацию
                        <LineBreak/>
                        об искомом пациенте:
                        <LineBreak/>
                    </TextBlock>
                    <TextBlock Margin="20,0,0,0"
                               FontStyle="Italic">
                        Номер карточки
                        <LineBreak/>
                        Фамилия
                        <LineBreak/>
                        Имя
                        <LineBreak/>
                        Отчество
                        <LineBreak/>
                        Код заболевания
                        <LineBreak/>
                        Заболевание
                        <LineBreak/>
                    </TextBlock>
                    <TextBlock>
                        Параметры поиска могут быть указанны в любом сочетании и порядке.
                    </TextBlock>
                </StackPanel>
            </Border>
        </ResourceDictionary>
    </Page.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="110"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid VerticalAlignment="Stretch"
					HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border BorderBrush="{StaticResource GrouperBorderBrush}"
					BorderThickness="1"
					CornerRadius="3"
					Padding="10,0,10,10"
					Margin="15,0,0,15">
                <StackPanel VerticalAlignment="Center">
                    <TextBlock Foreground="{StaticResource MarkingFontColor}"
                       			Text="Группировaть:"/>
                    <RadioButton Name="DoctorGroupCheckBox"
                         		Margin="10,5,0,0"
                         		Click="DoctorGroupCheckBox_Click">По лечащаму врачу</RadioButton>
                    <RadioButton Name="DiseaseGroupRadioButton"
                         		Margin="10,5,0,0"
                         		Click="DiseaseGroupRadioButton_Click">По заболеванию</RadioButton>
                    <RadioButton Name="NoGoupingRadioButton"
                         		Margin="10,5,0,0"
                         		Click="NoGoupingRadioButton_Click">Не группировать</RadioButton>
                </StackPanel>
            </Border>
            <Border BorderThickness="1"
					BorderBrush="{StaticResource GrouperBorderBrush}"
					CornerRadius="3"
					Margin="30,0,15,15"
					VerticalAlignment="Center"
					HorizontalAlignment="Stretch"
					Grid.Column="1"
					SnapsToDevicePixels="True">
                <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                    <TextBlock Foreground="{StaticResource MarkingFontColor}"
                           				VerticalAlignment="Center"
										HorizontalAlignment="Center"
                       					Text="Поиск медкарт"
										FontSize="12"
										FontWeight="Bold"/>
                    <WrapPanel VerticalAlignment="Top"
									Margin="0,10,0,25">
                        <AdornerDecorator>
                            <TextBox Name="SearchStringTextBox" 
                                         Width="400" 
                                         Margin="15,0,0,0"
                                         FontSize="12"
                                         VerticalAlignment="Center"
                                         Height="21"
                                         Style="{StaticResource SearchTextBoxStyle}"
                                         ToolTip="{StaticResource SearchToolTipText}">
                                <Res:WatermarkService.Watermark>
                                    <TextBlock Text="Строка поиска"
                                                       FontStyle="Italic"
                                                       FontFamily="Arial"
                                                       FontSize="12"
                                                       Foreground="Black"
                                                       VerticalAlignment="Center"/>
                                </Res:WatermarkService.Watermark>
                            </TextBox>
                        </AdornerDecorator>

                        <Button Name="SearchButton" 
                    				VerticalAlignment="Bottom"
                    				Margin="35,0,0,0"
                    				BorderThickness="1"
                    				SnapsToDevicePixels="True"
                    				Style="{StaticResource SearchButton}"
                    				Height="30"
                    				Width="110"
                    				Click="SearchButton_Click">Искать</Button>
                    </WrapPanel>
                </StackPanel>
            </Border>
        </Grid>
        <Grid Grid.Row="1" Margin="15,0,15,20">
            <Controls:DataGrid Name="PatientsGrid" IsReadOnly="True" AutoGenerateColumns="False">
                <Controls:DataGrid.Columns>
                    <Controls:DataGridTextColumn Header="Номер карточки" Binding="{Binding PatientNumber, Mode=OneWay}" Width="*"/>
                    <Controls:DataGridTextColumn Header="Фамили И.О." Binding="{Binding FullName, Mode=OneWay}" Width="*"/>
                    <Controls:DataGridTextColumn Header="Код заболевания" Binding="{Binding DTCDisease.Code, Mode=OneWay}" />
                    <Controls:DataGridTextColumn Header="Лечащий врач" Binding="{Binding DTCDoctor.FullName, Mode=OneWay}" Width="*"/>
                </Controls:DataGrid.Columns>
            </Controls:DataGrid>
            <Border Name="RecorsListBoxControlPanel"
						Margin="1,1,0,0"
						HorizontalAlignment="Left"
						Width="35" 
						Style="{StaticResource ListBoxControlPanel}"
						CornerRadius="6,0,0,6" BorderThickness="0,0,1,0">
                <StackPanel>
                    <Button Name="AddRecord"
                        			Height="25" Width="25"
									Margin="0,5,0,0"
                        			Style="{StaticResource AddRecButton}"
                        			VerticalAlignment="Top"
                        			HorizontalAlignment="Center"
								 	Click="AddRecord_Click"
                                    ToolTip="Добавить новую карточку"/>
                </StackPanel>
            </Border>
        </Grid>
    </Grid>
</Page>

